import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

public class Vibration extends Canvas{
	private Display display;
	private Profiles profiles;
	public Vibration(GameMIDlet midlet, Display display){
		this.display = display;	
		profiles = new Profiles(midlet,display);
		setFullScreenMode(true);
	}
	public void paint(Graphics g){
		if(Option.language == true){
			g.setColor(255, 255, 255);
			g.fillRect(0, 0, 128, 160);
			g.setColor(0, 0, 0);
			//g.drawLine(64,0,64,160);
			g.drawString("Bat Che Do Rung ?", 26, 65, 0);	
			g.drawString("Co", 2, 145, 0);
			g.drawString("Khong", 96, 145, 0);

		}
		else{
			g.setColor(255, 255, 255);
			g.fillRect(0, 0, 128, 160);
			g.setColor(0, 0, 0);
			//g.drawLine(64,0,64,160);
			g.drawString("Enable Vibable ?", 30, 65, 0);	
			g.drawString("Yes", 2, 145, 0);
			g.drawString("No", 114, 145, 0);

		}
	}
	protected void keyPressed(int code){
		if(code == -6){
			Option.vibration = true;	
			display.vibrate(500);	
			display.setCurrent(profiles);
		}	
		if(code == -7){		
			Option.vibration = false;	
			display.setCurrent(profiles);
		}	
	}
}